Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix write to a nil map during contract maintenance #165

Merged
merged 4 commits into from
Aug 2, 2023

Conversation

mike76-dev
Copy link
Contributor

I know that siad will only be receiving critical updates. However, even if this has been working fine so far, we might be catching edge cases, or any forks of siad might be catching this.

@mike76-dev mike76-dev changed the title Main Fix write to a nil map during contract maintenance Aug 1, 2023
@n8maninger
Copy link
Member

n8maninger commented Aug 2, 2023

From a glance, it looks like numFailedRenews is assigned in threadedContractMaintenance before any write calls. Did you hit a panic? Regardless, I'm not opposed to merging. My only change would be putting back all the types.BlockHeight. It's annoying, but better to be consistent when there's no real reason to change it.

@mike76-dev
Copy link
Contributor Author

I hit a deadlock when running contract maintenance. While debugging, I found that the map could be read from but couldn't be written to.
Regarding the types, I will put them back; however, I find it weird to use types.BlockHeight when semantically it's just a counter that is incremented every time a renewal fails.

@n8maninger n8maninger merged commit 1e6967c into SiaFoundation:master Aug 2, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants